package com.etc.dao;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

import com.etc.entity.Account;

/**
 * 
 * @ClassName: AccountMapper 
 * @Description: TODO(这里用一句话描述这个类的作用) 
 * @author knowno  
 * @date 2022年4月1日 下午4:47:25 
 *
 */
@Repository
public interface AccountMapper {

	@Update(value = "update tbl_account set balance = balance+ #{balance} where accountid = #{toid}")
	public int transin(@Param("toid") Integer toid,@Param("balance") double balance);
	
	
	@Update(value = "update tbl_account set balance = balance- #{balance} where accountid = #{fromid}")
	public int transout(@Param("fromid") Integer fromid,@Param("balance") double balance);

	
	@Select(value = "select * from tbl_account where accountid=#{accountid}")
	public Account getById(int accountid);
}
